#ifndef HUANBUTTON_H
#define HUANBUTTON_H

#include <qqtclickwidget.h>

namespace Ui {
class HuanButton;
}

class HuanButton : public QQtClickWidget
{
    Q_OBJECT
    Q_ENUMS ( EStatus )

public:
    explicit HuanButton ( QWidget* parent = 0 );
    ~HuanButton();

    enum EStatus
    {
        eHBtnNormal,
        eHBtnEdit,
        eHBtnMax
    };

    QString text();
    QString icon();
    QWidget* widget();
    void setText ( QString btnText );
    void setIcon ( QString icon );
    void setIconSize ( QSize size );
    QSize iconSize();
    void setTextFont ( const QFont& font );

    //这个status可能是caidanbutton的
    void setStatus ( EStatus status ) {
        mStatus = status;

        if ( mStatus == eHBtnEdit )
            closeWidget.show();
        else
            closeWidget.hide();
    }

    //主要是对geometry不放心，等页面初始化完再初始化这个icon。
    void initCloseIcon();

private:
    Ui::HuanButton* ui;
    EStatus mStatus;
    QQtClickWidget closeWidget;
    QString mIcon;
};

#endif // HUANBUTTON_H
